import React from 'react'
import {browserHistory, Router} from 'react-router'
import {Provider} from 'react-redux'
import PropTypes from 'prop-types'
import Toast from "./Toast"
import Dialog from "./Dialog"
import LoginView from "../layouts/LoginView/LoginView"

class App extends React.Component {
	static propTypes = {
		store: PropTypes.object.isRequired,
		routes: PropTypes.object.isRequired,
	}

	shouldComponentUpdate() {
		return false
	}

	render() {
		return (
			<Provider store={this.props.store}>
				<div style={{height: '100%'}}>
					<Toast/>
					<Dialog/>
					<LoginView/>
					<Router history={browserHistory} children={this.props.routes}/>
				</div>
			</Provider>
		)
	}
}

export default App
